﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;

namespace EmgrMvc.Models
{
    public class MyContext : DbContext
    {
        public MyContext() : base(
                new DbContextOptionsBuilder<MyContext>()
                .UseSqlite("Filename=d:\\db\\app.db")
                .Options)
        {
        }
        public MyContext(DbContextOptions<MyContext> Options) : base(Options)
        {
        }
//        public DbSet<A> A { get; set; } //在数据库中生成数据表A
        public DbSet<MqttController> MqttControllers { get; set; }
        public DbSet<Device> Devices { get; set; }
        public DbSet<DeviceType> Types { get; set; }
        public DbSet<DeviceGroup> Groups { get; set; }
        public DbSet<GroupMember> GroupMembers { get; set; }
        public DbSet<JobData> jobDatas { get; set; }
        public DbSet<Trigger> Triggers { get; set; }
        public DbSet<ScheduleJob> scheduleJobs { get; set; }
        public DbSet<OntimeJob> OntimeJobs { get; set; }
    }
}